#ifndef __TPS_FUNCTION_H__
#define __TPS_FUNCTION_H__

namespace Tps
{

	namespace Private
	{

		template <typename T>
		struct Method;

		template <typename R, typename C>
		struct Method<R (C::*)()>
		{
			enum { IsConstMtd = false };
			enum { ParamsCount = 0 };
			typedef C Class;
			typedef R Ret;
		};

		template <typename R, typename C, typename P1>
		struct Method<R (C::*)(P1)>
		{
			enum { IsConstMtd = false };
			enum { ParamsCount = 1 };
			typedef C Class;
			typedef R Ret;
			typedef P1 Param1;
		};

		template <typename R, typename C, typename P1, typename P2>
		struct Method<R (C::*)(P1, P2)>
		{
			enum { IsConstMtd = false };
			enum { ParamsCount = 2 };
			typedef C Class;
			typedef R Ret;
			typedef P1 Param1;
			typedef P2 Param2;
		};

		template <typename R, typename C, typename P1, typename P2, typename P3>
		struct Method<R (C::*)(P1, P2, P3)>
		{
			enum { IsConstMtd = false };
			enum { ParamsCount = 3 };
			typedef C Class;
			typedef R Ret;
			typedef P1 Param1;
			typedef P2 Param2;
			typedef P3 Param3;
		};

		template <typename R, typename C, typename P1, typename P2, typename P3, typename P4>
		struct Method<R (C::*)(P1, P2, P3, P4)>
		{
			enum { IsConstMtd = false };
			enum { ParamsCount = 4 };
			typedef C Class;
			typedef R Ret;
			typedef P1 Param1;
			typedef P2 Param2;
			typedef P3 Param3;
			typedef P4 Param4;
		};

		template <typename R, typename C, typename P1, typename P2, typename P3, typename P4, typename P5>
		struct Method<R (C::*)(P1, P2, P3, P4, P5)>
		{
			enum { IsConstMtd = false };
			enum { ParamsCount = 5 };
			typedef C Class;
			typedef R Ret;
			typedef P1 Param1;
			typedef P2 Param2;
			typedef P3 Param3;
			typedef P4 Param4;
			typedef P5 Param5;
		};

		template <typename R, typename C>
		struct Method<R (C::*)() const>
		{
			enum { IsConstMtd = true };
			enum { ParamsCount = 0 };
			typedef C Class;
			typedef R Ret;
		};

		template <typename R, typename C, typename P1>
		struct Method<R (C::*)(P1) const>
		{
			enum { IsConstMtd = true };
			enum { ParamsCount = 1 };
			typedef C Class;
			typedef R Ret;
			typedef P1 Param1;
		};

		template <typename R, typename C, typename P1, typename P2>
		struct Method<R (C::*)(P1, P2) const>
		{
			enum { IsConstMtd = true };
			enum { ParamsCount = 2 };
			typedef C Class;
			typedef R Ret;
			typedef P1 Param1;
			typedef P2 Param2;
		};

		template <typename R, typename C, typename P1, typename P2, typename P3>
		struct Method<R (C::*)(P1, P2, P3) const>
		{
			enum { IsConstMtd = true };
			enum { ParamsCount = 3 };
			typedef C Class;
			typedef R Ret;
			typedef P1 Param1;
			typedef P2 Param2;
			typedef P3 Param3;
		};

		template <typename R, typename C, typename P1, typename P2, typename P3, typename P4>
		struct Method<R (C::*)(P1, P2, P3, P4) const>
		{
			enum { IsConstMtd = true };
			enum { ParamsCount = 4 };
			typedef C Class;
			typedef R Ret;
			typedef P1 Param1;
			typedef P2 Param2;
			typedef P3 Param3;
			typedef P4 Param4;
		};

		template <typename R, typename C, typename P1, typename P2, typename P3, typename P4, typename P5>
		struct Method<R (C::*)(P1, P2, P3, P4, P5) const>
		{
			enum { IsConstMtd = true };
			enum { ParamsCount = 5 };
			typedef C Class;
			typedef R Ret;
			typedef P1 Param1;
			typedef P2 Param2;
			typedef P3 Param3;
			typedef P4 Param4;
			typedef P5 Param5;
		};

	}

}

#endif	// !__TPS_FUNCTION_H__
